/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2011
 */

package com.mw.businuss.user.model;

import javacommon.base.BaseEntity;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class Userinfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Userinfo";
	public static final String ALIAS_CUID = "cuid";
	public static final String ALIAS_USERNAME = "username";
	public static final String ALIAS_AGE = "age";
	public static final String ALIAS_ADRESS = "adress";
	public static final String ALIAS_PHONE = "phone";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * cuid       db_column: CUID 
     */	
	@Length(max=32)
	private java.lang.String cuid;
    /**
     * username       db_column: USERNAME 
     */	
	@Length(max=80)
	private java.lang.String username;
    /**
     * age       db_column: AGE 
     */	
	
	private Long age;
    /**
     * adress       db_column: ADRESS 
     */	
	@Length(max=200)
	private java.lang.String adress;
    /**
     * phone       db_column: PHONE 
     */	
	@Length(max=15)
	private java.lang.String phone;
	//columns END

	public Userinfo(){
	}

	public Userinfo(
		java.lang.String cuid
	){
		this.cuid = cuid;
	}

	public void setCuid(java.lang.String value) {
		this.cuid = value;
	}
	
	public java.lang.String getCuid() {
		return this.cuid;
	}
	public void setUsername(java.lang.String value) {
		this.username = value;
	}
	
	public java.lang.String getUsername() {
		return this.username;
	}
	public void setAge(Long value) {
		this.age = value;
	}
	
	public Long getAge() {
		return this.age;
	}
	public void setAdress(java.lang.String value) {
		this.adress = value;
	}
	
	public java.lang.String getAdress() {
		return this.adress;
	}
	public void setPhone(java.lang.String value) {
		this.phone = value;
	}
	
	public java.lang.String getPhone() {
		return this.phone;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Cuid",getCuid())
			.append("Username",getUsername())
			.append("Age",getAge())
			.append("Adress",getAdress())
			.append("Phone",getPhone())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getCuid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Userinfo == false) return false;
		if(this == obj) return true;
		Userinfo other = (Userinfo)obj;
		return new EqualsBuilder()
			.append(getCuid(),other.getCuid())
			.isEquals();
	}
}

